from flask import Flask
from flask_cors import CORS, cross_origin
from .views import blue
from .views2 import blue2
def create_app():
    app = Flask(__name__)
    # 配置静态文件夹
    app.static_url_path = 'App/static'  # 静态资源的URL前缀
    app.static_folder = 'static'  # 静态资源存储的文件夹
    # 注册蓝图
    app.register_blueprint(blueprint=blue)
    app.register_blueprint(blueprint=blue2)
    # 跨域
    CORS(app, resources=r'/*',origins="*")
    return app